package com.bpf.base.base.exception;

public enum TestError {
    //通用错误
    SUCCESS("0000", "正确返回"),
    ERROR("9999", "服务器未知错误"),
    HASH_ERROR("9998", "参数验签失败"),
    TIMESTAMP_ERROR("9997", "手机时间设置有误"),
    CAPTCHA_ERROR("9996", "验证码错误或已过期"),
    IMEI_ERROR("9995", "IMEI格式错误"),
    DEVICE_PHONE_NO_FORMAT_ERROR("9994", "devicePhoneNo设备手机号格式错误"),
    DEVICE_OS_TYPE_ERROR("9993", "deviceOsType设备操作系统错误"),
    DEVICE_OS_VERSION_ERROR("9992", "deviceOsVersion设备操作系统版本错误"),
    DEVICE_SP_ERROR("9991", "deviceSP运营商错误"),
    DEVICE_MAC_ERROR("9990", "deviceMAC错误"),
    TOKEN_ERROR("9989", "TOKEN错误"),
    BUSINESS_FORMAT_ERROR("8999", "业务方返回格式错误"),
    BUSINESS_ERROR("8998", "业务方调用错误"),
    LOGIN_ERROR("8997", "用户名或密码错误"),
   ;
		public String code;
		
		public String message;
		
		private TestError(String code, String message) {
			this.code = code;
			this.message = message;
		}
		
		public BusinessException buildException() {
			return new BusinessException(this.code, this.message);
		}
		
		public void throwException() throws BusinessException {
			throw buildException();
		}
}

